﻿namespace T.FAS.Runtime.Base.Entity
{
    /// <summary>
    /// 掩码规则
    /// </summary>
    public class MaskingRule
    {
        /// <summary>
        /// 是否启用掩码，默认为否
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 是否启用部分掩码，默认为否（即：全部掩码）
        /// </summary>
        public bool IsPartialMasking { get; set; }

        /// <summary>
        /// 掩码字符，默认为 *
        /// </summary>
        public char MaskingCharacter { get; set; } = '*';

        /// <summary>
        /// 规则类型，0:系统规则 1:自定义规则
        /// </summary>
        public MaskingType MaskingType { get; set; }

        /// <summary>
        /// 掩码规则标识，guid所有规则运行时取
        /// </summary>
        public string RuleID { get; set; }

        /// <summary>
        /// 掩码规则名称
        /// </summary>
        public string RuleName { get; set; }

        /// <summary>
        /// 正则表达式匹配规则
        /// </summary>
        public string RegPattern { get; set; }

        /// <summary>
        /// 替换值
        /// </summary>
        public string Replacement { get; set; }
    }

    public enum MaskingType
    {
        System = 0,
        Custom = 1,
    }
}
